import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Day04 {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] result = getFBetween(n);
//        System.out.println(Arrays.toString(result));
        System.out.println(Math.min(n - result[0], result[1] - n));
    }

    // l <= r <= n
    private static int[] getFBetween(int n) {
        if (n == 1) {
            return new int[]{1, 1};
        }
        int l = 1, r = 1;
        while (n > r) {
            int tmp = r;
            r = r + l;
            l = tmp;
        }
        return new int[]{l, r};
    }

    public static void main2(String[] args) {
//        ["XYZE","SFZS","XDEE"],"XYZZED"
        String[] s = new String[]{"XYZE","SFZS","XDEE"};
        String key = "XYZZED";
//        ["XYZE","SFZS","XDEE"],"SEE"
//        String[] s = new String[]{"XYZE","SFZS","XDEE"};
//        String key = "SEE";
        System.out.println(exist(s, key));
    }

    // num2
    public static boolean exist (String[] board, String word) {
        int[][] isOccupy = initOccupy(board);
        // 每一个点都要测试过
        for (int i = 0; i < board.length; i++) {
            for (int j = 0; j < board[i].length(); j++) {
                if (find(board, word, isOccupy, 0, j, i)) return true;
            }
        }

        return false;
    }

    /**
     *     --------> x
     *     | "XYZE"
     *     | "SFZS"
     *     | "XDEE"
     *     y
     */
    private static boolean find(String[] board, String word, int[][] isOccupy, int curIndexOfWord, int x, int y) {
        if (word.length() <= curIndexOfWord) {
            // 找到了
            return true;
        }
        // 上下左右都要看一看
        if ((0 <= y && y < board.length && x >= 0) && x < board[y].length() && isOccupy[y][x] == 0
               && word.charAt(curIndexOfWord) == board[y].charAt(x) ) {
            // 满足基本条件 可以试一试
            // 上下左右 如果有一个满足直接return
            isOccupy[y][x] = 1;
            curIndexOfWord++;
            if (find(board, word, isOccupy, curIndexOfWord, x, y - 1) || // 上
                    find(board, word, isOccupy, curIndexOfWord, x, y + 1) || // 下
                    find(board, word, isOccupy, curIndexOfWord, x - 1, y) || // 左
                    find(board, word, isOccupy, curIndexOfWord, x + 1, y) // 右
            ) return true;
            curIndexOfWord--;
            isOccupy[y][x] = 0;
        }
        // 超出下标或者已经使用过了
        return false;
    }

    private static int[][] initOccupy(String[] board) {
        int[][] result = new int[board.length][];
        for (int i = 0; i < board.length; i++) {
            result[i] = new int[board[i].length()];
        }
        return result;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        List<Integer> prev = new ArrayList<>(n);
        List<Integer> cur = new ArrayList<>(n);
        System.out.printf("%5d\n", 1);
        // 从第二行开始
        for (int i = 2; i <= n; i++) {
            cur.add(1);
            System.out.printf("%5d", 1);
            for (int j = 2; j <= i; j++) {
                if (j == i) {
                    cur.add(1);
                    System.out.printf("%5d", 1);
                } else {
                    int num = prev.get(j - 2) + prev.get(j - 1);
                    cur.add(num);
                    System.out.printf("%5d", num);
                }
            }
            System.out.println();
            prev = cur;
            cur = new ArrayList<>(n);
        }
    }
}
